<?php

/**
 * Model is the base model class.
 * All model classes without active record for this application should extend from this base class.
 */
class Model {

    private static $_models;

    /**
     * Returns the static model of the specified class.
     * @param string $className active class name.
     * @return Model the static model class
     */
    public static function model($className = __CLASS__) {
        if (empty(self::$_models[$className])) {
            self::$_models[$className] = new $className(null);
        }
        return self::$_models[$className];
    }

}
